Component({
  properties: {},
  data: {},
  methods: {
    message: function() {
      wx.navigateTo({
        url: '../my_message/my_message',
      })
    },
    scan: function() {
      var that = this;
      var show;
      wx.scanCode({
        success: (res)=> {
          this.show = "结果:" + res.result + "二维码类型:" + res.scanType + "字符集:" + res.charSet + "路径:" + res.path;
          that.setData({
            show: this.show
          })
          console.log( res.path + '/user_id/' + wx.getStorageSync('uid'));
          wx.request({
            url: res.path + '/user_id/' + wx.getStorageSync('uid'),
            success:function(res){
              console.log(res)
              if(res.data.code == 200)
              {
                wx.navigateTo({
                  url: '../scan_qr_suc/scan_qr_suc?venue_id='+res.data.data.venue_id + '&user_id=' + res.data.data.user_id,
                })
              }
              if(res.data.code == 100019)
              {
                wx.navigateTo({
                  url: '../scan_qr_err/scan_qr_err?code=1&msg=' + res.data.msg,
                })
              }
              if (res.data.code == 100025) {
                wx.navigateTo({
                  url: '../scan_qr_err/scan_qr_err?code=2&msg=' + res.data.msg,
                })
              }   
              if (res.data.code == 100026) {
                wx.navigateTo({
                  url: '../scan_qr_err/scan_qr_err?code=3&msg=' + res.data.msg,
                })
              }                          
            }
          })

        }       
      })
    }
  }
})